package com.chrray.position.enums.app;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 职位性质：1-短期,2-长期,3-新农人
 */
public enum FdJobType implements BaseEnum{
    SHORT_TERM(1, "短期"),
    LONG_TERM(2, "长期"),
    NEW_FARMER(3, "新农人")
    ;

    @JsonValue
    @EnumValue
    private final Integer value;
    private final String info;

    FdJobType(Integer value, String info) {
        this.info = info;
        this.value = value;
    }

    @JsonCreator
    public static FdJobType getByValue(Integer value) {
        for (FdJobType en : FdJobType.values()) {
            if (en.getValue().equals(value)) {
                return en;
            }
        }
        return null;
    }

    @JsonCreator
    public static FdJobType getByInfo(String info) {
        for (FdJobType en : FdJobType.values()) {
            if (en.getInfo().equals(info)) {
                return en;
            }
        }
        return null;
    }

    public Integer getValue() {
        return value;
    }

    public String getInfo() {
        return info;
    }
}
